from typing import Annotated
from fastapi import APIRouter, Header
from app.service.banpick_service import (
    player_press_button, player_roll_pet_type
)
import traceback

banpick_router = APIRouter(
    prefix="/banpick",
    tags=["banpick"],
    responses={404: {"description": "Not found"}},
)

"""
用户的点击中心按钮的操作（准备，ban，pick）
"""
@banpick_router.post("/playerAction")
async def playerAction(payload: dict, token: Annotated[str | None, Header()] = None):
    return await player_press_button(token, payload)

"""
用户重新随机属系
"""
@banpick_router.post("/rollType")
async def rollType(token: Annotated[str | None, Header()] = None):
    return await player_roll_pet_type(token)

